A video decoding refers to a process of decompressing an encoded video data. There are mainly two decoding modes, one is decoding using software, i.e., a software decoding mode, and the other is decoding using hardware, i.e., a hardware decoding mode. After decompressing the video data, displaying the decompressed video data or signal.
Currently, in general, when starting to decode a video file, i.e., before the video file is played, people can choose a hardware decoding mode or a software decoding mode by themselves. However, once a decoding mode is chosen, the decoding mode cannot be changed. It can only use the decoding mode which has been chosen. Furthermore, during a video decoding process, the decoding mode cannot be switched automatically. If the people want to switch the decoding mode, they need to exit the decoding process. It can only manually re-choose the decoding mode before the video file is played, and re-decoding the video file from a first frame of the video file, so that the operating efficiency is low. In addition, in the video decoding process, once a decoding exception occurs, it can only exit the video decoding process. Therefore, the video decoding process is failed, and it needs to re-choose other decoding mode to decode manually, so that the operating efficiency is low and it is a poor user experience.
Although most of current video decoding processes use a hardware decoding mode, the hardware decoding mode may not be able to decode normally due to hardware limitations and in some special cases. In this case, a software decoding mode may be able to decode normally. Similarly, when using the software decoding mode to decode a video file, as the decoding proceeds, the software decoding Mode may not be able to decode normally. For example, as the decoding proceeds, a decoding speed is slow due to a high CPU load or an insufficient memory, which causes that a time of completed decoding is longer than a time of displaying, and resulting in a frame dropping, a screen being clogging, a black screen or a screen sticking, so that the visual effect is poor. In this case, the hardware decoding mode may be able to decode normally, and the hardware decoding has low power consumption, a CPU load is relatively low. Therefore, in the video decoding process, it needs to switch the decoding mode automatically, so as to improve the decoding efficiency.